package com.njupt.towersystem.config;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.Charset;
//布隆过滤器
@Configuration
public class SystemConfig {
    @Bean
    public BloomFilter<String> namepwdFilter(){
        BloomFilter<String > bf = BloomFilter.create(
                Funnels.stringFunnel(Charset.forName("utf-8"))
                , 1000000, 0.0625);
        return bf;
    }
}
